// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

// ****************************************************************************
//  avtBlueprintOptions.C
// ****************************************************************************

#include <avtBlueprintOptions.h>

#include <DBOptionsAttributes.h>

#include <string>


// ****************************************************************************
//  Function: GetBlueprintReadOptions
//
//  Purpose:
//      Creates the options for Blueprint readers.
//
//  Programmer: Chris Laganella -- generated by xml2avt
//  Creation:   Mon Nov 1 16:28:25 PST 2021
// 
//  Modifications:
//      Justin Privitera, Mon Apr 11 18:20:19 PDT 2022
//      Added setting for Legacy or New MFEM LOR and added it to options.
// 
//      Justin Privitera, Tue Oct 18 09:53:50 PDT 2022
//      Removed inaccurate comment.
//
// ****************************************************************************

DBOptionsAttributes *
GetBlueprintReadOptions(void)
{
    DBOptionsAttributes *rv = new DBOptionsAttributes;
    std::vector<std::string> mfem_lor_setting;
    mfem_lor_setting.push_back("Legacy LOR");
    mfem_lor_setting.push_back("MFEM LOR");
    rv->SetEnum("MFEM LOR Setting", 1);
    rv->SetEnumStrings("MFEM LOR Setting", mfem_lor_setting);

    return rv;
/* EXAMPLE OF OPTIONS
    rv->SetBool("Binary format", true);
    rv->SetBool("Big Endian", false);
    rv->SetEnum("Dimension", 1);
    vector<string> dims;
    dims.push_back("0D");
    dims.push_back("1D");
    dims.push_back("2D");
    dims.push_back("3D");
    rv->SetEnumStrings("Dimension", dims);
    rv->SetInt("Number of variables", 5);
    rv->SetString("Name of auxiliary file", );
    rv->SetDouble("Displacement factor", 1.0);

    // When reading or writing the file, you can get the options out of this object like:
    rv->GetDouble("Displacement factor");
*/
}


// ****************************************************************************
//  Function: GetBlueprintWriteOptions
//
//  Purpose:
//      Creates the options for Blueprint writers.
//
//  Important Note:
//      The code below sets up empty options.  If your format does not require
//      write options, no modifications are necessary.
//
//  Programmer: Chris Laganella -- generated by xml2avt
//  Creation:   Mon Nov 1 16:28:25 PST 2021
//
//  Modifications:
//  
//  Chris Laganella Wed Dec 15 17:54:25 EST 2021
//  Only add the options if flatten/partition are supported.
// 
//    Justin Privitera, Tue Aug 23 14:40:24 PDT 2022
//    Removed `CONDUIT_HAVE_PARTITION_FLATTEN` check.
// 
//    Justin Privitera, Tue Jul  9 10:47:29 PDT 2024
//    Added Blueprint Relay I/O extra options.
//
// ****************************************************************************

DBOptionsAttributes *
GetBlueprintWriteOptions(void)
{
    DBOptionsAttributes *rv = new DBOptionsAttributes;

    rv->SetEnum("Operation", 0);
    std::vector<std::string> ops;
    ops.push_back("None");
    ops.push_back("Flatten_CSV");
    ops.push_back("Flatten_HDF5");
    ops.push_back("Partition");
    rv->SetEnumStrings("Operation", ops);

    // TODO add in later once https://github.com/LLNL/conduit/issues/1291 is fixed
    // rv->SetEnum("Output type", 0);
    // std::vector<std::string> output_types;
    // output_types.push_back("HDF5");
    // output_types.push_back("YAML");
    // output_types.push_back("JSON");
    // rv->SetEnumStrings("Output type", output_types);

    rv->SetInt("Partition target number of domains", 0);

    rv->SetMultiLineString("Flatten / Partition extra options", "");

    rv->SetMultiLineString("Blueprint Relay I/O extra options", "");

    return rv;
}
